
/**
 *判断小程序是否登录
 *
 */
const Utils = require('../controllers/utils');
module.exports = async (ctx, next) => {
    const uid =  Utils.decipherOpenid(ctx)
    if(!uid){
        return ctx.error({msg: '你还没有授权登录',data: {code: 401}})
    }else{
        await next()
    }
}